package day2018_lab02;

public class Test19 {
    public static void main(String[] args) {


        //编写一个程序，实现字符串的
        // 大小写转换并倒序输出，如输入为“HelloWord”，输出为“DROwOLLEH”。
        String hello = "HelloWorld";
        System.out.println(hello.charAt(0));
        System.out.println(hello.indexOf("or"));
        String[] n= hello.split("o");
        System.out.println(n[0]);


        StringBuffer stringBuffer = new StringBuffer();

        for (int i=0;i<hello.length();i++){
            char tmp= hello.charAt(i);
            if (tmp>'A'&&tmp<'Z'){

                System.out.println(stringBuffer.append((char)(tmp+32)));

            }else{
                stringBuffer.append((char)(tmp-32));
            }

        }

        System.out.println(stringBuffer.reverse());

    }
}
